package com.example.properties1.message;

import jakarta.annotation.PostConstruct;
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * ClassName:ReceiveMessage
 * Package:com.example.properties1.message
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/8/15-17:14
 * @Version:v1.0
 */
//@Component
@Slf4j
public class ReceiveMessage {

    public static final String QUEUE_NAME = "queue.properties.3";

    @RabbitListener(queues = {QUEUE_NAME})
    public void receiveMsg1(Message message) {
        log.info("1 接收到的消息为:{}", new String(message.getBody()));
    }

    @RabbitListener(queues = {QUEUE_NAME})
    public void receiveMsg2(Message message) {
        log.info("2 接收到的消息为:{}", new String(message.getBody()));
    }

    @RabbitListener(queues = {QUEUE_NAME})
    public void receiveMsg3(Message message) {
        log.info("3 接收到的消息为:{}", new String(message.getBody()));
    }

}
